package com.wuyaya.arch.bom.obj;


import java.util.HashMap;
import java.util.Map;

public class WuObjectDefinition {
    private String packageName;
    private String name;
    private String label;
    private String tableName;
    private String objectManager;
    private String objectKey;
    private Map<String, WuProperty> properties = new HashMap<>();


    public WuObjectDefinition(String packageName, String objectName, String label, String tableName, String objectManager, String objectKey) {
        this.packageName = packageName;
        this.name = objectName;
        this.label = label;
        this.tableName = tableName;
        this.objectManager = objectManager;
        this.objectKey = objectKey;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getObjectManager() {
        return objectManager;
    }

    public void setObjectManager(String objectManager) {
        this.objectManager = objectManager;
    }

    public String getObjectKey() {
        return objectKey;
    }

    public void setObjectKey(String objectKey) {
        this.objectKey = objectKey;
    }

    public Map<String, WuProperty> getProperties() {
        return properties;
    }

    public void setProperties(Map<String, WuProperty> properties) {
        this.properties = properties;
    }

    public void addProperty(WuProperty property) {
        properties.put(property.getName(), property);
    }
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("WuObjectDefinition{")
                .append("packageName='").append(packageName).append('\'')
                .append(", name='").append(name).append('\'')
                .append(", label='").append(label).append('\'')
                .append(", tableName='").append(tableName).append('\'')
                .append(", objectManager='").append(objectManager).append('\'')
                .append(", objectKey='").append(objectKey).append('\'')
                .append(", properties=").append(properties)
                .append('}');
        return sb.toString();
    }
}
